Skip to content

feat(store): open SQLite Stores Normal and default PostgreSQL to local - #732

Merged
yifanxuaaa merged 1 commit into
layerfs_v2_0_0from
claude/normal-durability
Nov 17, 2026
Merged

yifanxuaaa merged 1 commit into
layerfs_v2_0_0from
claude/normal-durability

Conversation

@yifanxuaaa

Copy link
Copy Markdown
Contributor

Summary

Owner direction 2026-11-17: enable the Normal mode on SQLite and PostgreSQL now, merge, and troubleshoot afterwards. This is the minimum of layerfs-project#155 §7 stage N1 that makes Normal the mode in use.

SQLite

  • New profile SqlitePersistenceProfile::Normal: WAL, synchronous=1 (NORMAL), fullfsync=0, wal_autocheckpoint=0.
  • Every product opener selects it: the daemon (install and owner), the Store service (install and SDK open), project add and discovery, Store identity, compact, SQLite transfer and backup restore.
  • The session's checkpoint thread opened its connection at synchronous=0. It now takes the session's value and reads it back. Under NORMAL a pass at 0 would mark log frames copied that never reached the disk.
  • The Init, live-add and install gates accept Normal or Disposable and still refuse Durable. Disposable stays selectable, so existing tests that select it keep running at OFF.

PostgreSQL

  • synchronous_commit defaults to local (it was off): the persistence default, store.connect and the open arguments. A Store connected earlier keeps its recorded value.

Not in this change

  • The safety proof (v0.1.7: Architecture Refactor Migration — initialize the bridge release to the 0.2.0 model #155 §7.5) and the performance gate (§7.6) have not run. No power-loss guarantee is claimed, and the commit-path cost of NORMAL is unmeasured.
  • Store files written outside SQLite are still not synchronized (§7.3): install, transfer, restore, snapshot and home records.
  • The manifest wire byte (2) and the record label are unchanged, so store.get still reports profile: "disposable".
  • No PostgreSQL server prerequisite check (fsync, full_page_writes).
  • PersistenceConfig::sqlite still defaults to Durable.
  • Daemon images must be rebuilt to pick this up.

Checks (macOS host, Rust 1.85.1, one run each, every command under 120 s)

  • cargo check --workspace --all-targets, cargo fmt --check, Clippy -D warnings on the seven changed crates, product boundary guard: pass.
  • Tests pass: layerfs-persistence (the five profile, checkpoint and publication files only), and all test files of layerfs-project, layerfs-store-service (79), layerfs-bridge, layerfs-daemon, layerfs-store, layerfs-bucket, layerfs-api (75), layerfs-cli (25) and layerfs-control (43 of 44).
  • One failure: layerfs-control observed_control::observed_facade_borrows_scope_with_same_two_pointer_layout (size_of::<WorkspaceApi>() is 64, expected 16). This change touches no file in layerfs-control or layerfs-sandbox; I did not run it on the base.
  • Not run: Linux, FUSE mounts, PostgreSQL-backed tests that need a server, the JavaScript and Python tests, and the rest of the layerfs-persistence suite.

Production LOC: 187380 -> 187394 (delta +14); engine 89372 -> 89386, core, control and api unchanged. Counter: tools/production_loc.py, first parent 9203d99db0 against the committed tree.

🤖 Generated with Claude Code

…l (layerfs-project#155 §7)

Owner direction 2026-11-17: enable the Normal mode on both backends now,
ahead of its safety and performance gate; troubleshooting follows.

SQLite
- New profile SqlitePersistenceProfile::Normal: WAL, synchronous=1 (NORMAL),
  fullfsync=0, wal_autocheckpoint=0, identity sqlite-wal-normal-v2.
- Every product opener selects it: the daemon (install and owner), the
  Store service (install and SDK open), project add and discovery, Store
  identity, compact, SQLite transfer and backup restore.
- The session's checkpoint thread opened its connection at synchronous=0.
  It now takes the session's value and reads it back; under NORMAL a pass
  at 0 would mark log frames copied that never reached the disk.
- The Init, live-add and install gates accept Normal or Disposable and
  still refuse Durable. Disposable stays selectable, so existing tests that
  select it keep running at synchronous=OFF.

PostgreSQL
- synchronous_commit defaults to local (it was off): SynchronousCommit's
  default, PostgresSelection::new, store.connect and the open arguments.
  A Store connected earlier keeps its recorded value; a recorded "off" is
  still honoured.

Not in this change (known gaps, #155 §7)
- The safety proof (§7.5) and the performance gate (§7.6) have not run.
  No power-loss guarantee is claimed.
- Store files written outside SQLite are still not synchronized (§7.3):
  install, transfer, restore, snapshot and home records.
- The manifest wire byte (2) and the record label ("disposable") are
  unchanged; store.get still reports profile "disposable".
- No PostgreSQL server prerequisite check (fsync, full_page_writes).
- PersistenceConfig::sqlite still defaults to Durable.

Tests
- background_checkpoint.rs: the same long-log case now also runs under
  Normal and asserts the read-back profile (synchronous=1).
- open_args.rs: the default setting is "local".
- No test deleted.

Docs: root and engine AGENTS.md persistence-profile rule, the SQLite
architecture page, the PostgreSQL default in the Store pages and the SDK
skill reference.

Production LOC: 187380 -> 187394 (delta +14)
Scope and method: tools/production_loc.py at this commit, first parent
9203d99 against the committed tree; core 40408 -> 40408, engine
89372 -> 89386, control 51073 -> 51073, api 6527 -> 6527; reference absent
(retired R9c; last counted 65,417 at tree 498dd19).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yifanxuaaa
yifanxuaaa merged commit 6bca861 into layerfs_v2_0_0 Nov 17, 2026
2 checks passed
@yifanxuaaa
yifanxuaaa deleted the claude/normal-durability branch November 18, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant